{extend name="layout/base" /}

{block name="title"}选择支付方式 - 我的购物车 - {mall:config name="mall.sitename"/}{__block__}{/block}

{block name="meta"}
{__block__}
<link href="__ADDON__/__STYLE__/css/cart.css" rel="stylesheet">
{/block}

{block name="body"}
<body class="shopping_cart_page">
{/block}

{block name="main"}
<div class="container">
	
    <div class="pay-sbox-head">
    	<a href='{$Request.root.true}'>首页</a>&nbsp;&gt;&nbsp;支付
    </div>
    <div>
    	<div class="pay-tip1"></div>
    </div>
    <div class='pay-sbox'>
    	<div>
	    <div class="tips-box">
	    	请及时付款，以便快速处理您的订单，在线实付金额<span class="mall-fred">&nbsp;¥{$object['totalMoney']}&nbsp;&nbsp;&nbsp;&nbsp;</span>
			<span id="mall-check-orders" class="mall-check-orders">查看订单详情</span>
	    </div>
	    <div>
		    <div id="mall-orders-box" style="display:none;">
			    <table class='mall-order-list'>
				 	{volist name="$rs['list']" id="order"}
				 	<thead>
					 	<tr>
					     	<td colspan="3" class="mall-left-noborder mall-align-left">订单号：{$order['orderNo']}</td>
					        <td colspan="3" class="mall-right-noborder mall-align-right">订单金额：￥{$order['needPay']}【运费：￥{$order['deliverMoney']}】</td>
					 	</tr>
					 	<tr class='head'>
					         <td colspan="2" class="mall-left-noborder">商品</th>
					         <th width="150">商品单价</th>
					         <th width="150">数量</th>
					         <th width="150" class="mall-right-noborder">商品总价</th>
					   	</tr>
				   </thead>
				   <tbody class="otbody">
				 	{volist name="$rs['goods'][$order['orderId']]" id="vo"}
				 	<tr>
				     	<td class="mall-left-noborder" width="64">
				     		<div class="goods-img">
					     		<a href="{:url('home/goods/detail',array('ids'=>$vo['goods_id']))}" target="_blank">
					     			<img class='goodsImg' src="__MALLCDN__{$vo['goodsimg']}"  title="{$vo['goodsname']}" width='60'/>
					     		</a>
				     		</div>
				     	</td>
				        <td class="mall-align-left">
				        	<div>{$vo['goodsname']}
				        	{if condition="count($vo['goodsSpecNames']) gt 0"}
				        		【
				        		{volist name="$vo['goodsSpecNames']" id="spec"}
				        		{$spec}&nbsp;
				        		{/volist}
				        		】
				        	{/if}
				        	</div>
				        </td>
				        <td>{$vo['goodsPrice']}</td>
				        <td>{$vo['goodsNum']}</td>
				        <td class="mall-right-noborder">{$vo['goodsPrice']*$vo['goodsNum']}</td>
				 	</tr>
				 	{/volist}
				 	{/volist}
			       </tbody>
			    </table>
		    </div>
			<form action="{:addon_url('mall/order/submit')}" id="paynow-form" method="post" >
				<input type="hidden" id="c-orderNo" name="orderNo" value="{$orderNo}"/>
				<input type="hidden" id="c-isBatch" name="isBatch" value="{$isBatch}"/>
				<input type="hidden" id="c-paymoney" name="paymoney" value="{$object['totalMoney']}"/>
				<hr>
				<div class="row my-4 text-center">
					<div class="col-xs-4">
						<div class="form-check">
							<input class="form-check-input" type="radio" name="paycode" id="paycode-wechat"
								   value="wechat" checked>
							<label class="form-check-label" for="paycode-wechat">
								<img src="__MALLCDN__/uploads/sysconfigs/2016-10/wechat.png" height="30" alt="">
							</label>
						</div>
					</div>
					<div class="col-xs-4">
						<div class="form-check">
							<input class="form-check-input" type="radio" name="paycode" id="paycode-alipay"
								   value="alipay">
							<label class="form-check-label" for="paycode-alipay">
								<img src="__MALLCDN__/uploads/sysconfigs/2016-10/alipay.png" height="30" alt="">
							</label>
						</div>
					</div>
					<div class="col-xs-4" {if !$user}style="display:none"{/if}>
						<div class="form-check">
							<input class="form-check-input" type="radio" name="paycode" id="paycode-balance" value="balance">
							<label class="form-check-label" for="paycode-balance" data-toggle="tooltip" data-title="余额：￥{$user.money|default=0}">
								<img src="__MALLCDN__/uploads/sysconfigs/2016-10/balance.png" height="30" alt="">
							</label>
						</div>
					</div>
				</div>
				<hr>
				<div class="row mt-2">
					<div class="col text-center">
						<button type="submit" class="btn btn-primary btn-submit-pay">立即支付</button>
					</div>
				</div>
			</form>
	    </div>
        </div>
    </div>
</div>
<div id="alipayform" style="display:none;"></div>
{/block}

{block name="js"}
{__block__}

<script>
$(function(){
	$("#mall-check-orders").click(function(){
		$("#mall-orders-box").slideToggle(600);
	});
	$("div[class^=mall-payCode]").click(function(){
		var payCode = $(this).attr("data");
		$("div[class^=mall-payCode]").each(function(){
			$(this).removeClass().addClass("mall-payCode-"+$(this).attr("data"));
		});
		$(this).removeClass().addClass("mall-payCode-"+payCode+"-curr");
		$("#payCode").val(payCode);
	});
	if($("div[class^=mall-payCode]").length>0){
		$("div[class^=mall-payCode]")[0].click();
	}
});

</script>
{/block}